<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <title>添加/修改页示例</title>

    <th:block th:include="fragment_header :: header">
    </th:block>
</head>
<body>
<div th:replace="fragment_menu :: navmenu"></div>
<h5 class="text-center">新增/修改考试信息</h5>
<div class="card">
    <div class="card-body">
        <form action="#" th:action="@{ /exam/save }" th:object="${examModel}" method="post" class="form-horizontal">
            <input th:field="*{id}" type="hidden" name="id"/>
            <input th:field="*{version}" type="hidden" name="version"/>
            <div class="alert alert-warning" role="alert" th:if="${ #fields.hasErrors() }">
                <ul>
                    <li th:each="err : ${ #fields.allDetailedErrors() }">&nbsp;<span th:text="${ err.message }"></span>
                    </li>
                </ul>
            </div>

            <div class="row">
                <label class="col-sm-2 col-form-label">考试名称 *</label>
                <div class="col-sm-10">
                    <div class="form-group bmd-form-group">
                        <input th:field="*{name}" class="form-control" placeholder="请输入考试名称"/>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-sm-2 col-form-label">考试日期 *</label>
                <div class="col-sm-10">
                    <div class="form-group bmd-form-group">
                        <!--                        <input th:field="*{examAt}" class="form-control" required/>-->
                        <input th:field="*{examAt}" type="datetime-local" class="form-control"/>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-sm-2 col-form-label">考试时长 *</label>
                <div class="col-sm-10">
                    <div class="form-group bmd-form-group">
                        <input th:field="*{timeLimit}" class="form-control" placeholder="请输入考试时长"/>
                    </div>
                </div>
            </div>
            <div class="row">
                <label class="col-sm-2 col-form-label">考试总分 *</label>
                <div class="col-sm-10">
                    <div class="form-group bmd-form-group">
                        <input th:field="*{totalScore}" class="form-control" placeholder="请输入考试总分"/>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-10 offset-sm-2">
                    <div class="form-group">
                        <button type="submit" name="save" class="btn btn-primary">保存</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

</body>
</html>
